<template>
  <el-container class="el-container">
    <el-aside width="200px">
      <!--  -->
      <el-menu
        default-active="msbd"
        class="el-menu-vertical-demo"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b"
        :router="true"
      >
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>面试宝典</span>
          </template>
          <el-menu-item index="msbd">
            <i class="el-icon-menu"></i>
            <span slot="title">面试宝典</span>
          </el-menu-item>
          <el-menu-item index="msbd/classify">
            <i class="el-icon-menu"></i>
            <span slot="title">列表管理</span>
          </el-menu-item>
        </el-submenu>

        <el-menu-item index="test">
          <i class="el-icon-setting"></i>
          <span slot="title">在线考试</span>
        </el-menu-item>
        <el-menu-item index="users">
          <i class="el-icon-setting"></i>
          <span slot="title">用户管理</span>
        </el-menu-item>
      </el-menu>
      <!--  -->
    </el-aside>
    <el-container>
      <el-header>
        <div class="header">
          <div class="head_lef">BK后台管理</div>
          <div class="heaf_rig">
            <el-dropdown @command="handleCommand">
              <span class="el-dropdown-link">
                用户:xwp(管理员)
                <i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>个人中心</el-dropdown-item>
                <el-dropdown-item>系统设置</el-dropdown-item>
                <el-dropdown-item command="doLogout">安全退出</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </div>
      </el-header>
      <el-main><Nuxt /></el-main>
      <el-footer>Footer</el-footer>
    </el-container>
  </el-container>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  methods: {
    async handleCommand(command) {
      if (command == "doLogout") {
        await this.$store.dispatch("users/doLogout");

        this.$router.push("/login");
      }
    },
  },
};
</script>
<style>
html,
body,
#__nuxt,
#__layout {
  height: 100%;
}
</style>
<style scoped>
.el-menu {
  border-right: 0;
}
.el-container {
  height: 100%;
}
.el-header {
  font-size: 20px;
  line-height: 60px;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
}

.el-aside {
  background-color: rgb(84, 92, 100);
}

.el-main {
  background-color: #e9eef3;
}

.head_lef {
  float: left;
}

.heaf_rig {
  float: right;
}

.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}

body > .el-container {
  margin-bottom: 40px;
}

/* .el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
} */
</style>